#ifndef _MESSAGE_H
#define _MESSAGE_H

#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>


typedef uint16_t message_type_t;
typedef uint16_t message_id_t;


typedef struct {
	int    		v;
	uintptr_t   p;
}message_data_t;


typedef struct {
	message_type_t   	type;
	message_id_t   		id;
	message_data_t			data;
}message_t;




#define MSG_TYPE_UART   	1
#define MSG_TYPE_LLC		2
#define MSG_TYPE_MAC		3
#define MSG_TYPE_PHY		4
#define MSG_TYPE_BBB		5
#define MSG_TYPE_TIMER		6

#define MSG_ID_IDLE_IRQ  			1
#define MSG_ID_LLC_REC_PKG			2

#define MSG_ID_MA_UNITDATA_request		30
#define MSG_ID_MA_UNITDATA_confirm		31
#define MSG_ID_MA_UNITDATA_indicate		32

#define MSG_ID_DATA_request			3
#define MSG_ID_DATA_confirm			4
#define MSG_ID_DATA_indicate		5

#define MSG_ID_TX_START_request		6
#define MSG_ID_TX_START_confirm		7
#define MSG_ID_TX_END_request		8
#define MSG_ID_TX_END_confirm		9
#define MSG_ID_RX_START_indicate	10
#define MSG_ID_RX_END_indicate		11
#define MSG_ID_CCA_indicate			12
#define MSG_ID_CCA_RESET_request	13
#define	MSG_ID_CCA_RESET_confirm	14

#define MSG_ID_TXSTART				15
#define MSG_ID_DATA_REQ				16
#define MSG_ID_DATA_REPLY			17



#endif
